﻿using System;
using System.Text;

namespace CSExample {
	public class ParameterDemo {
		public ParameterDemo () {
			
		}

		public static void Run () {
			Console.WriteLine ("ParameterDemo");

			StringBuilder first = new StringBuilder ();
			first.Append ("hello");
			StringBuilder second = first;
			first.Append (" world");
			Console.WriteLine (second); // Prints hello world

			string a = "hello";
			string b = a;
			a = "world";

			Console.WriteLine ("a:" + a);
			Console.WriteLine ("b:" + b);

			StringBuilder y = new StringBuilder ();
			y.Append ("hello");
			Foo (y);
			Console.WriteLine (y);

			int a1 = 10;
			int a2 = 20;
			ShowNumbers (1, 2, 3);
			ShowNumbers (a1, a2);
			int [] xa = { 11, 12, 13 };
			ShowNumbers (xa);
		}

		static void Foo (StringBuilder x) {
			x.Append (" world");
		}

		static void ShowNumbers (params int [] numbers) {
			foreach (int x in numbers) {
				Console.Write (x + " ");
			}
			Console.WriteLine ();
		}
	}
}
